package com.xuecheng.content.controller;

import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.content.service.Commonservice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 根据申请人手机号获取验证码
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class CommonController {

    @Autowired
    private Commonservice commonservice;
    //发送短信
    @GetMapping("/common/smsMsg")
    public ResponseResult smsMsg(@RequestParam Map<String, String> param){
        // 1.接收请求参数
        String phone = param.get("phone");
        // 2.调用service发短信
        return commonservice.smsMsg(phone);

    }
}
